<template>
    <div class="active-root">
        <div class="jieshao">
            <h2 class="activ-title">活动介绍</h2>
            <div v-for="j in proInfo.xiangqing.jieshao">
                <h3 class="item-title">{{j.title}}</h3>
                <p class="item-content">{{j.content}}</p>
                <img :src="p" v-for="p in j.img" class="pic">
            </div>
        </div>
        <div class="liucheng">
            <h2 class="item-title">{{proInfo.xiangqing.liucheng.title}}</h2>
            <p class="item-content" v-for="p in proInfo.xiangqing.liucheng.content">{{p}}</p>
            <img :src="pic" v-for="pic in proInfo.xiangqing.liucheng.img" class="lc-pic">
        </div>
        <div class="tiyan">
            <h2 class="tiyan-title">{{proInfo.xiangqing.tiyan.title}}</h2>
            <img :src="proInfo.xiangqing.tiyan.img">
            <div class="tiyan-info">
                <p class="tiyan-content">{{proInfo.xiangqing.tiyan.content}}</p>
                <div class="userinfo">
                    <p>
                        <img :src="proInfo.xiangqing.tiyan.avatar">
                        <span style="font-size:13px;font-weight:700">{{proInfo.xiangqing.tiyan.name}}</span>
                        <span class="hunter-tag">{{proInfo.xiangqing.tiyan.shenfen}}</span>
                    </p>
                    <p>{{proInfo.xiangqing.tiyan.time}}</p>
                </div>
            </div>
        </div>
        <div class="xiangsi">
            <h2 class="tiyan-title">{{proInfo.xiangqing.xiangsi.title}}</h2>
            <ProductView>
                <router-link to="/getmore" class="a-box" v-for="x in proInfo.xiangqing.xiangsi.xsarr">
                        <div class="product-item">
                            <div class="item-pic">
                                <img :src="x.img">
                            </div>
                            <p class="item-text">{{x.content}}</p>
                            <div class="info">
                                <div class="rating"></div>
                                <p>￥{{x.price}}</p>
                            </div>
                        </div>
                    </router-link>
            </ProductView>
        </div>
        <div class="foot">
            <div class="mask"></div>
            <h1>立即成为猎人</h1>
        </div>
    </div>
</template>

<script>
import {mapState} from 'vuex';
import ProductView from './ProductView.vue';
export default {
    components:{
        ProductView,
    },
    computed:{
        ...mapState([
            "proInfo",
        ])
    },
}
</script>

<style scoped>
.active-root{
    color: #5c5c5c;
    width: 100vw;
    background-color: #fff;
}
.activ-title{
    margin: 8px 3vw 18px;
    font-size: 16px;
    font-weight: 400;
    line-height: 22px;
}
.item-title{
    margin: 5px 3vw 8px;
    font-weight: 600;
    font-size: 15px;
}
.item-content{
    margin: 0 3vw;
    font-size: 14px;
}
.pic{
    width: 100vw;
    max-width: 640px;
    display: block;
    margin: 10px 0;
}
.liucheng{
    margin: 12px 0 8px;
}
.lc-pic{
    width: 100vw;
    max-width: 640px;
    display: block;
    margin: 10px 0;
}
.tiyan{
    color: #5c5c5c;
    margin: 24px 0 20px;
}
.tiyan-title{
    font-size: 16px;
    font-weight: 400;
    line-height: 22px;
    margin: 0 3vw 13px;
}
.tiyan img{
    margin: 0 3vw;
    width: 90vw;
}
.tiyan-info{
    margin: 10px 3vw 30px;
}
.tiyan-content{
    margin: 0;
    width: 90vw;
    white-space: normal;
    font-size: 13px;
    height: 36px;
    line-height: 18px;
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
}
.userinfo{
    display: flex;
    justify-content: space-between;
    width: 90vw;
}
.userinfo>p:nth-of-type(1){
    height: 36px;
    display: flex;
    align-items: center;
}
.userinfo>p:nth-of-type(1) span{
    display: inline-block;
}
.userinfo img{
    width: 36px;
    height: 36px;
    border-radius: 50%;
}
.hunter-tag{
    margin-left: 9px;
    color: #fff;
    background-color: #f47517;
    border-radius: 10px;
    padding:1px 6px;
    font-size: 11px;
}
.userinfo>p:nth-of-type(2){
    line-height: 3rem;
    font-size: 13px;
    color: #aaa;
}
.xiangsi{
    margin: 24px 0 20px;
    width: 100vw;
    overflow: hidden;
}
.a-box{
    display: inline-block;
}
.product-item {
    display: inline-block;
    margin-left: 14px;
    width: 140px;
}
.item-pic {
    margin-bottom: 8px;
    position: relative;
}

.item-pic img {
    width: 140px;
    height: 110px;
}
.item-text {
    white-space: normal;
    margin: 0;
    font-size: 13px;
    color: #4a4a4a;
    width: 140px;
    height: 36px;
    overflow:hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px;
    white-space: wrap;
    line-height: 18px;
}
.info {
    display: flex;
    justify-content: space-between;
    font-size: 16px;
}
.info p{
    margin: 0;
    color: #f47517;
}
.foot{
    background-image: url("/static/img/hunter.jpg");
    position: relative;
    background-position: center center;
    background-size: cover;
    margin-top: 28px;
    width: 100vw;
    height: 163px;
}
.foot .mask{
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top:0;
    background: rgba(0, 0, 0, .4);
}
.foot h1{
    width: 40vw;
    height: 5vh;
    line-height: 5vh;
    font-size: 1rem;
    color: #fff;
    font-weight: 600;
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    margin: 0;
    padding-top: 0.2rem;
    padding-bottom: 2.3rem;
    transform: translate(-50%,-50%);
    border: 1px solid #fff;
    border-radius: 1.5rem;
}
</style>